home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Brotikasten
/
BROTCD01.iso
/
lern
/
lern338.d64
/
ma010 bairs eq
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-08-09
|
1KB
|
67 lines
1 REM *** BAIRSTOW
2 REM W HAWES
3 REM
4 REM *** PET USER GROUP
5 REM SOFTWARE EXCHANGE
6 REM PO BOX 371
7 REM MOTGOMERYVILLE,PA 1936
8 REM
10 POKE59468,12
19000 PRINT"[147]"
19010 REM PROGRAM SUBMITTED BY W. HAWES
19020 REM HALIFAX, N.S. CANADA
19030 PRINT"PROGRAM BAIRSTOW"
19032 PRINT
20000 PRINT"PROGRAM TO SOLVE AN N'TH ORDER"
20002 PRINT"POLYNOMIAL EQUATION OF THE FORM"
20004 PRINT"Y^N + A1*Y^(N-1) +....+AN = 0
20006 [153]"WHERE A1,A2,....,AN ARE REAL.
20008 PRINT"BAIRSTOW'S ITERATIVE METHOD IS
20010 [153]"USED TO YIELD SUCCESSIVE
20012 PRINT"QUADRATIC FACTORS AND THE
20014 [153]"RESULTANT REDUCED ORDER
20016 PRINT"POLYNOMIAL
20020 [153]
20022 [153]"PRESS ANY KEY WHEN READY"
20024 [161]A$:[139]A$[178]""[167]20024
20100 [153]"LOAD"
20102 [133]"ENTER ORDER N OF POLYNOMIAL";N
20110 P[178]0:Q[178]0:Z[178]0
20120 [134]A(N),B(N),C(N):C(0)[178]1
20130 [129]L[178]1[164]N
20140 [153]"ENTER A";L;:[133]A(L)
20150 [130]L
20155 [153]:[153]
20160 B(1)[178]A(1)[171]P:B(2)[178]A(2)[171]P[172]B(1)[171]Q
20170 [129]K[178]3[164]N
20180 B(K)[178]A(K)[171]P[172]B(K[171]1)[171]Q[172]B(K[171]2)
20190 [130]K
20200 C(1)[178]B(1)[171]P:C(2)[178]B(2)[171]P[172]C(1)[171]Q
20210 [129]K[178]3[164]N
20215 C(K)[178]B(K)[171]P[172]C(K[171]1)[171]Q[172]C(K[171]2)
20220 [130]K
20230 CB[178]C(N[171]1)[171]B(N[171]1)
20240 DP[178]B(N[171]1)[172]C(N[171]2)[171]B(N)[172]C(N[171]3)
20245 DP[178]DP[173](C(N[171]2)[172]C(N[171]2)[171]CB[172]C(N[171]3))
20250 DQ[178]B(N)[172]C(N[171]2)[171]B(N[171]1)[172]CB
20255 DQ[178]DQ[173](C(N[171]2)[172]C(N[171]2)[171]CB[172]C(N[171]3))
20260 P[178]P[170]DP:Q[178]Q[170]DQ
20270 M[178][182](DP)[170][182](DQ):Z[178]Z[170]1
20280 [153]"ON";"ITERATION #";Z;" ERROR =";M
20290 [139]M[179].0000001[167]20320
20300 [137]20160
20320 [153]
20340 [153]"P = ";P
20350 [153]"Q = ";Q
20360 [153]
20370 [153]"P & Q ARE A QUADRATIC FACTOR OF"
20380 [153]"THE FORM Y^2 +P*Y + Q = 0"
20390 [153]
20400 [153]"THE RESULTANT FACTOR IS OF THE"
20410 [153]"FORM: Y^(N-2) + B1Y(N-3)+...+B(N-2)"
20420 [153]"WHERE:"
20430 [129]K[178]1[164]N[171]2
20440 [153]"B";K;" = ";B(K)
20450 [130]K
20460 [128]